import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  //首页
  {
    path: "/",
    name: "about",
    meta: {
      title: "输入页",
    },
    component: () => import("../view/about/index.vue"),
  },
  {
    path: "/home",
    name: "home",
    meta: {
      title: "首页",
    },
    component: () => import("../view/home/Home.vue"),
  },
];

const router = new VueRouter({
  routes,
  mode: "history",
});

router.beforeEach((to, from, next) => {
  // if (localStorage.getItem('market')) {
  //   next({ path: '/home' })
  // } else {
  //   next({ path: '/' })
  // }
  next()
})

export default router;
